<template>
    <div class="declareFinish container">
        <div class="finish_list">
            <div class="tabCommonTitle">
                <span>申报完成</span>
            </div>
            <div class="tableForm">
                <table style="text-align:center;" width="1110" border="" cellspacing="0" align="center" cellpadding="">
                    <tr>
                        <td width="180">申报单位：</td>
                        <td colspan="3" class="td_text">{{sbdw_qymc}}</td>
                    </tr>
                    <!-- <tr>
                        <td width="180">推荐单位：</td>
                        <td colspan="3" class="td_text">{{tjdw}}</td>
                    </tr> -->
                    <tr>
                        <!-- <td width="180">推荐单位：</td>
                        <td colspan="3" class="td_text">{{tjdw}}</td> -->
                        <td width="180">推荐单位：</td>
                        <td width="350" class="td_text">{{tjdw}}</td>
                        <td width="240">推荐单位联系信息：</td>
                        <!-- 姓名+座机+邮箱 -->
                        <td v-if="tjdwInfo.tjdwxxSfgk=='Y'" width="340" class="td_text">{{tjdwInfo.tjdwxxLxr}}、{{tjdwInfo.tjdwxxZj}}、{{tjdwInfo.tjdwxxYx}}</td>
                    </tr>
                    <tr>
                        <td width="180">成果名称：</td>
                        <td colspan="3" class="td_text">{{cxjMcZw}}</td>
                    </tr>
                    <tr>
                        <td width="180">成果申报类别 ：</td>
                        <td width="350" class="td_text">{{fl_mc}}</td>
                        <td width="240">成果来源 ：</td>
                        <td width="340" class="td_text">{{cxjXmly}}</td>
                    </tr>
                    <tr>
                        <td width="180">成果研究起始时间：</td>
                        <td width="350" class="td_text">{{cxjQssj}}</td>
                        <td width="240">成果研究完成时间：</td>
                        <td width="340" class="td_text">{{cxjWcsj}}</td>
                    </tr>
                    <tr>
                        <td width="180"><i>*</i>联系人：</td>
                        <td colspan="3" class="td_text">{{lxrXm}}</td>
                        <!-- <td width="240">推荐单位联系人：</td>
                        <td width="340" class="td_text"></td> -->
                    </tr>
                    <tr>
                        <td width="180"><i>*</i>专利授权文件：</td>
                        <td width="350" class="td_text">{{zlsqwb_num}}</td>
                        <td width="240">专利证书：</td>
                        <td width="340" class="td_text">{{zlzs_num}}</td>
                    </tr>
                    <tr>
                        <td width="180"><i>*</i>其他附件：</td>
                        <td width="350" class="td_text">{{qtfj_num}}</td>
                    </tr>
                </table>
            </div>
          <!--
            <div class="tableList">
                <p class="list_title">其他材料信息</p>
                <table width="1110" align="center" cellpadding="">
                    <thead>
                        <tr>
                            <th width="200" style="text-align:left;padding-left:30px;">序号</th>
                            <th>材料名称</th>
                            <th width="220">内容要求</th>
                            <th width="150">当前字数</th>
                            <th width="150" style="text-align:center;">是否符合要求</th>
                        </tr>
                    </thead>

                    <tbody>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">1</td>
                            <td><em>*</em>专利基本信息</td>
                            <td>必填</td>
                            <td>
                                <span v-if="zl_flag">已填</span>
                                <span v-else>未填</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="zl_flag && zl.isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">2</td>
                            <td><em>*</em>专利质量评价材料</td>
                            <td v-if="xl_id=='5103'">2000字以内</td>
                            <td v-else>2500字以内</td>
                            <td>
                                <span v-if="zlpj_flag">{{zlpjList[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="zlpj_flag && zlpjList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr v-if="xl_id!='5103'">
                            <td style="text-align:left;padding-left:30px;">3</td>
                            <td><em>*</em>技术先进性评价材料</td>
                            <td>3000字以内</td>
                            <td>
                                <span v-if="jsxjx_flag">{{jsxjxList[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="jsxjx_flag && jsxjxList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr v-if="xl_id=='5103'">
                            <td style="text-align:left;padding-left:30px;">3</td>
                            <td><em>*</em>设计要点及理念的表达评价材料</td>
                            <td>2000字以内</td>
                            <td>
                                <span v-if="sjyd_flag">{{sjydList[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="sjyd_flag && sjydList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">4</td>
                            <td><em>*</em>保护措施和成效评价（一）</td>
                            <td v-if="xl_id=='5103'">2500字以内</td>
                            <td v-else>3000字以内</td>
                            <td>
                                <span v-if="bh1_flag">{{bh1List[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="bh1_flag && bh1List[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">5</td>
                            <td><em>*</em>保护措施和成效评价（二）</td>
                            <td>500字以内</td>
                            <td>
                                <span v-if="bh2_flag">{{bh2List[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="bh2_flag && bh2List[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">6</td>
                            <td><em>*</em>社会效益与发展前景评价</td>
                            <td v-if="xl_id=='5103'">3000以内</td>
                            <td v-else>2500以内</td>
                            <td>
                                <span v-if="shxy_flag">{{shxyList[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="shxy_flag && shxyList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">7</td>
                            <td><em>*</em>曾获奖励情况</td>
                            <td>500字以内</td>
                            <td>
                                <span v-if="hjqk_flag">{{hjqkList[0].fileNumber}}字</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="hjqk_flag && hjqkList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;padding-left:30px;">8</td>
                            <td><em>*</em>单位意见</td>
                            <td>必须上传</td>
                            <td>
                                <span v-if="dwyj_flag">已上传</span>
                                <span v-else>未上传</span>
                            </td>
                            <td style="text-align:center;">
                                <span v-if="dwyj_flag && dwyjList[0].isValid">
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/success.png" alt="">
                                </span>
                                <span v-else>
                                    <img style="width:18px;height:18px;margin-right:11px;" src="@/assets/img/fail.png" alt="">
                                </span>
                            </td>
                        </tr>
                    </tbody>

                </table>
            </div>
            -->
            <div>
                <div v-if="from=='zj'">
                    <div class="submit_btn" :class="is_modify=='Y'?'':'disabled'" v-if="xmztbh=='101'||xmztbh=='201'||xmztbh=='302'">申报未提交</div>
                    <div class="submit_btn" :class="is_modify=='Y'?'':'disabled'" v-else-if="xmztbh!='100'&&xmztbh!='101'&&xmztbh!='201'&&xmztbh!='302'">申报已提交</div>
                </div>
                <div v-else>
                    <div class="submit_btn pointer" @click="submit_sb" v-if="xmztbh=='101'||xmztbh=='201'||xmztbh=='302'">提交申报</div>
                    <div class="submit_btn" :class="is_modify=='Y'?'':'disabled'" v-else-if="xmztbh!='100'&&xmztbh!='101'&&xmztbh!='201'&&xmztbh!='302'">申报已提交</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import {
    zlsb_getSbwc,
    zlsb_sbwc,
    cxjsbCglylist,
    cxjsbValidlist,
    cxjsbGetCxjByid,
    cxjtjGetTjdwxxBycgid
} from '@/api/shenbao';
    export default {
        name: 'patentDeclareFinish',
        data() {
            return {
                tjdwInfo: {},
                cxj_cxj_id: '',
                cglylist: [],
                cxjXmly: '',
                validlist: [],
                fl_mc: '',
                sbwc: {},
                sbdw_qymc: '',
                tjdw: '',
                cxjMcZw: '',
                wcdwlist: '',
                wcrlist: '',
                ssyyfj_num: '',
                qtfj_num: '',
                zlsqwb_num: '',
                zlzs_num: '',
                cxjQssj: '',
                cxjWcsj: '',
                zl: '',
                zl_flag: '',
                zlpjList: [],
                zlpj_flag: '',
                jsxjxList: [],
                jsxjx_flag: '',
                bh1List: [],
                bh1_flag: '',
                bh2List: [],
                bh2_flag: '',
                shxy_flag: '',
                shxyList: [],
                hjqkList: '',
                hjqk_flag: '',
                dwyjList: [],
                dwyj_flag: '',
                sjydList: [],
                sjyd_flag: '',
                sbztbh: '',
                xmztbh: '',
                lxrXm: '',
                xl_id: '',
            }
        },
        props: ['is_modify','from'],
        methods: {
            getTjdwInfo(){
                cxjtjGetTjdwxxBycgid({cxj_cxj_id: this.cxj_cxj_id}).then(res=>{
                    // let data = res.data;
                    // if (data.code == 0) {
                    //     this.tjdwInfo = data.result;
                    // }
                })
            },
            initdata() {
                this.sbdw_qymc = this.sbwc.sbtjdw && this.sbwc.sbtjdw.sbdw_qymc;
                this.tjdw = this.sbwc.sbtjdw && this.sbwc.sbtjdw.tjdw;
                this.cxjMcZw = this.sbwc.cxj.cxjMcZw;
                this.wcdwlist = this.sbwc.wcdwMap && this.sbwc.wcdwMap.wcdwlist;
                this.wcrlist = this.sbwc.wcrMap && this.sbwc.wcrMap.wcrlist;
                this.ssyyfj_num = this.sbwc.ssyyfj_num;
                this.qtfj_num = this.sbwc.qtfj_num;
                this.zlsqwb_num = this.sbwc.zlsqwb_num;
                this.zlzs_num = this.sbwc.zlzs_num;
                this.cxjQssj = this.sbwc.cxj.cxjQssj;
                this.cxjWcsj = this.sbwc.cxj.cxjWcsj;
                this.zl = this.sbwc.zl;
                this.zl_flag = this.sbwc.zl_flag;
                this.zlpjList = this.sbwc.zlpjList;
                this.zlpj_flag = this.sbwc.zlpj_flag;
                this.jsxjxList = this.sbwc.jsxjxList;
                this.jsxjx_flag = this.sbwc.jsxjx_flag;
                this.bh1List = this.sbwc.bh1List;
                this.bh1_flag = this.sbwc.bh1_flag;
                this.bh2List = this.sbwc.bh2List;
                this.bh2_flag = this.sbwc.bh2_flag;
                this.shxy_flag = this.sbwc.shxy_flag;
                this.shxyList = this.sbwc.shxyList;
                this.hjqkList = this.sbwc.hjqkList;
                this.hjqk_flag = this.sbwc.hjqk_flag;
                this.dwyjList = this.sbwc.dwyjList;
                this.dwyj_flag = this.sbwc.dwyj_flag;
                this.sjydList = this.sbwc.sjydList;
                this.sjyd_flag = this.sbwc.sjyd_flag;
                this.lxrXm = this.sbwc.zllxrList && this.sbwc.zllxrList[0] && this.sbwc.zllxrList[0].lxrXm;
            },
            get_zlsb_getSbwc() {
                let that = this;
                zlsb_getSbwc({cxj_cxj_id: that.cxj_cxj_id}).then(res=>{
                    console.log(res, 'res');
                    if (res.data.code == '200') {
                        this.sbwc = res.data.result;
                        this.getCxjsbCglylist();
                        this.getCxjsbValidlist();
                        this.initdata();
                    }
                })
            },
            getCxjsbCglylist(){
                cxjsbCglylist().then(res=>{
                    let data = res.data;
                    if (data.success) {
                        this.cglylist = data.result;
                        for (var i=0;i<this.cglylist.length;i++) {
                            if (this.sbwc.cxj.cxjXmly == this.cglylist[i].cglyBh) {
                                this.cxjXmly =  this.cglylist[i].cglyMc;
                            }
                        }
                    }
                })
            },
            getCxjsbValidlist(){
                cxjsbValidlist().then(res=>{
                    let data = res.data;
                    if (data.success) {
                        this.validlist = data.result;
                        for (var i=0;i<this.validlist.length;i++) {
                            if (this.sbwc.cxj.flId == this.validlist[i].fl_id) {
                                this.fl_mc =  this.validlist[i].fl_mc;
                            }
                        }
                    }
                })
            },
            submit_sb() {
                let that = this;
                this.$confirm({
                    content: '提交之后不可修改，确定要提交吗？',
                    onOk() {
                        zlsb_sbwc({cxj_cxj_id: that.cxj_cxj_id}).then(res=>{
                            if (res.data.code == '200') {
                                that.$message.success('提交成功');
                                that.getCxjsbGetCxjByid();
                                that.$parent.getCxjsbGetCxjByid();
                            } else {
                                that.$message.error(res.data.message)
                            }
                        })
                    },
                    cancelText: '取消',
                    onCancel() {
                        that.destroyAll();
                    },
                });
            },
            destroyAll() {
                this.$destroyAll();
            },
            getCxjsbGetCxjByid(){
                cxjsbGetCxjByid({
                    cxj_cxj_id: this.cxj_cxj_id
                }).then(res=>{
                    let data = res.data;
                    if (data.success) {
                        this.sbztbh = data.result.sbztbh;
                        this.xmztbh = data.result.xmztbh;
                        this.xl_id = data.result.xl_id;
                    }
                })
            },
        },
        mounted() {
            this.cxj_cxj_id = this.$route.query.cxj_cxj_id;
            this.get_zlsb_getSbwc();
            this.getCxjsbGetCxjByid();
        }
    }
</script>

<style lang="less">
    td {
        input {
            width: 100%;
            height: 100%;
            border: 0;
            outline: 0;
        }
    }
    .ant-select-selection {
        border: 0;
    }
    .ant-select-selection__rendered {
        margin-left: 0;
        line-height: 40px;
    }
    .ant-select, .ant-select-selection, .ant-select-selection__rendered {
        width: 100%!important;
        height: 100%!important;
    }
    .ant-select-selection-selected-value {

        padding-left: 11px;
    }
    .ant-calendar-picker {
        width: 100%;
        height: 100%;
        div {
            width: 100%;
            height: 100%;
            input {
                width: 100%;
                height: 100%;
                border: 0;
                outline: 0;
            }
        }
    }
</style>
<style lang="less" scoped>
.tableForm {
    margin-top: 11px;
    table {
        border: 1px solid #ECEBEB;
        tr {
            height: 40px;
            td {
                color: #333333;
                font-size: 14px;
                font-weight: 400;
                i {
                    color: #CB0C0C;
                    margin-right: 5px;
                }
                &.td_text {
                    text-align: left;
                    padding: 0 20px;
                }
                input {
                    width: 100%;
                    height: 100%;
                    border: 0;
                    outline: 0;
                }
            }
        }
    }
}
.list_title {
    height: 22px;
    font-size: 16px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #3388EE;
    line-height: 22px;
    text-align: center;
}
.tableList {
    margin-top: 27px;
    table {
        margin-top: 20px;
        background: #FFFFFF;
        thead {
            background: #F5F5F5;
            tr {
                th {
                    height: 54px;
                    font-size: 16px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: bold;
                    color: #333333;
                }
            }
        }
        tbody {
            tr {
                height: 52px;
                border-bottom: 1px solid #E8E8E8;
                td {
                    color: #444444;
                    font-size: 14px;
                    font-weight: 400;
                    height: 52px;
                    em {
                        color: #CB0C0C;
                        margin-right: 5px;
                        font-style: normal;
                    }
                    i {
                        &.anticon-check-circle {
                            color: #67C235;
                        }
                        &.anticon-close-circle {
                            color: #CB0C0C;
                        }
                    }
                }
                &:nth-child(even){
                    background: #F5F5F5;
                }
            }
        }
    }
}
</style>
